<?php


namespace app\api\controller\v12;


use app\api\controller\v2\Auth;
use app\common\cachemodel\Recode as RecodeCacheModel;
use Exception;

class Recode extends Auth
{

    /**
     * @throws Exception
     * @version 1.9.4
     * 获取多档案信息
     */
    public function getMultiRecode()
    {
        $rids = input('param.rids', '');
        if (!$rids)
        {
            return show(config('code.error'), '未知的档案');
        }
        $RecodeCacheModel = new RecodeCacheModel();
        $recodes = $RecodeCacheModel->batchGetInfoByIds($rids);
        $data = [];
        foreach ($recodes as $recode)
        {
            $arr = $RecodeCacheModel->recodeInfoFormat($recode);
            $data[] = $arr;
        }
        return show(config('code.success'), '获取成功', $data);
    }
}
